<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="tutorial.css">
<TITLE>
Contents
</TITLE>
</HEAD>
<BODY >
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial002.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H1 CLASS="chapter">Contents</H1>
<UL CLASS="ftoc1"><LI CLASS="li-toc">
<A HREF="tutorial002.html#htoc1">Chapter&nbsp;1&nbsp;&nbsp;Introduction</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial002.html#htoc2">1.1&nbsp;&nbsp;Intended audience</A>
<LI CLASS="li-toc"><A HREF="tutorial002.html#htoc3">1.2&nbsp;&nbsp;Related work</A>
<LI CLASS="li-toc"><A HREF="tutorial002.html#htoc4">1.3&nbsp;&nbsp;Structure of tutorial</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc5">Chapter&nbsp;2&nbsp;&nbsp;High Level Design</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial003.html#htoc6">2.1&nbsp;&nbsp;Application structure</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc7">2.2&nbsp;&nbsp;Queries</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc8">2.3&nbsp;&nbsp;API</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc9">2.4&nbsp;&nbsp;High level structure</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial003.html#htoc10">2.4.1&nbsp;&nbsp;Classical LSCO structure</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc11">2.4.2&nbsp;&nbsp;Data transformation structure</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc12">2.4.3&nbsp;&nbsp;Data flow considerations</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc13">2.5&nbsp;&nbsp;Modules</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial003.html#htoc14">2.5.1&nbsp;&nbsp;Making predicates available</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc15">2.5.2&nbsp;&nbsp;Using packaged functionality</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc16">2.6&nbsp;&nbsp;Naming schemes</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial003.html#htoc17">2.6.1&nbsp;&nbsp;Modules and files</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc18">2.6.2&nbsp;&nbsp;Predicates</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc19">2.6.3&nbsp;&nbsp;Variables</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc20">2.7&nbsp;&nbsp;Documentation</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial003.html#htoc21">2.7.1&nbsp;&nbsp;Comment directive</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc22">2.7.2&nbsp;&nbsp;Documenting all interfaces</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc23">2.7.3&nbsp;&nbsp;Mode declaration</A>
<LI CLASS="li-toc"><A HREF="tutorial003.html#htoc24">2.7.4&nbsp;&nbsp;Documentation query</A>
</UL>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc25">Chapter&nbsp;3&nbsp;&nbsp;Data Structures</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial004.html#htoc26">3.1&nbsp;&nbsp;External data representation</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc27">3.2&nbsp;&nbsp;Internal data representation</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial004.html#htoc28">3.2.1&nbsp;&nbsp;Named structures</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc29">3.2.2&nbsp;&nbsp;Placeholder variables</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc30">3.2.3&nbsp;&nbsp;Nested structures vs. key lookup</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc31">3.2.4&nbsp;&nbsp;Lists</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc32">3.2.5&nbsp;&nbsp;Hash tables</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc33">3.2.6&nbsp;&nbsp;Vectors and arrays</A>
<LI CLASS="li-toc"><A HREF="tutorial004.html#htoc34">3.2.7&nbsp;&nbsp;Multi-representation structures</A>
</UL>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial005.html#htoc35">Chapter&nbsp;4&nbsp;&nbsp;Getting it to Work</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial005.html#htoc36">4.1&nbsp;&nbsp;Stubs</A>
<LI CLASS="li-toc"><A HREF="tutorial005.html#htoc37">4.2&nbsp;&nbsp;Argument checking</A>
<LI CLASS="li-toc"><A HREF="tutorial005.html#htoc38">4.3&nbsp;&nbsp;Early testing</A>
<LI CLASS="li-toc"><A HREF="tutorial005.html#htoc39">4.4&nbsp;&nbsp;Line Coverage</A>
<LI CLASS="li-toc"><A HREF="tutorial005.html#htoc40">4.5&nbsp;&nbsp;Heeding warnings</A>
<LI CLASS="li-toc"><A HREF="tutorial005.html#htoc41">4.6&nbsp;&nbsp;Keep it working</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc42">Chapter&nbsp;5&nbsp;&nbsp;Programming Concepts</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial006.html#htoc43">5.1&nbsp;&nbsp;Overview</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc44">5.2&nbsp;&nbsp;Alternatives</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc45">5.3&nbsp;&nbsp;Iteration on lists</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc46">5.4&nbsp;&nbsp;Iteration on terms</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc47">5.5&nbsp;&nbsp;Iteration on array</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc48">5.6&nbsp;&nbsp;Transformation</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc49">5.7&nbsp;&nbsp;Filter</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc50">5.8&nbsp;&nbsp;Combine</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc51">5.9&nbsp;&nbsp;Minimum</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc52">5.10&nbsp;&nbsp;Best and rest</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc53">5.11&nbsp;&nbsp;Sum</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc54">5.12&nbsp;&nbsp;Merge</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc55">5.13&nbsp;&nbsp;Group</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc56">5.14&nbsp;&nbsp;Lookup</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc57">5.15&nbsp;&nbsp;Fill matrix</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc58">5.16&nbsp;&nbsp;Cartesian</A>
<LI CLASS="li-toc"><A HREF="tutorial006.html#htoc59">5.17&nbsp;&nbsp;Ordered pairs</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc60">Chapter&nbsp;6&nbsp;&nbsp;Input/Output</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial007.html#htoc61">6.1&nbsp;&nbsp;Reading input data into data structures</A>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc62">6.2&nbsp;&nbsp;How to use DCGs</A>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc63">6.3&nbsp;&nbsp;Creating output data files</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial007.html#htoc64">6.3.1&nbsp;&nbsp;Creating Prolog data</A>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc65">6.3.2&nbsp;&nbsp;Simple tabular format</A>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc66">6.3.3&nbsp;&nbsp;Using <I>printf</I></A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc67">6.4&nbsp;&nbsp;Good and bad data formats</A>
<LI CLASS="li-toc"><A HREF="tutorial007.html#htoc68">6.5&nbsp;&nbsp;Report generation</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc69">Chapter&nbsp;7&nbsp;&nbsp;If it doesn't Work</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial008.html#htoc70">7.1&nbsp;&nbsp;Understanding failure</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial008.html#htoc71">7.1.1&nbsp;&nbsp;Run-time errors</A>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc72">7.1.2&nbsp;&nbsp;Environment limits</A>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc73">7.1.3&nbsp;&nbsp;Failure</A>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc74">7.1.4&nbsp;&nbsp;Wrong answer</A>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc75">7.1.5&nbsp;&nbsp;Missing answer</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc76">7.2&nbsp;&nbsp;Checking program points</A>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc77">7.3&nbsp;&nbsp;Debugger</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial008.html#htoc78">7.3.1&nbsp;&nbsp;Tracing</A>
<LI CLASS="li-toc"><A HREF="tutorial008.html#htoc79">7.3.2&nbsp;&nbsp;Jumping to a program point</A>
</UL>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc80">Chapter&nbsp;8&nbsp;&nbsp;Correctness and Performance</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial009.html#htoc81">8.1&nbsp;&nbsp;Testing</A>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc82">8.2&nbsp;&nbsp;Profiling</A>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc83">8.3&nbsp;&nbsp;Reviewing</A>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc84">8.4&nbsp;&nbsp;Issues to check for</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial009.html#htoc85">8.4.1&nbsp;&nbsp;Unwanted choicepoints</A>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc86">8.4.2&nbsp;&nbsp;Open streams</A>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc87">8.4.3&nbsp;&nbsp;Modified global state</A>
<LI CLASS="li-toc"><A HREF="tutorial009.html#htoc88">8.4.4&nbsp;&nbsp;Delayed goals</A>
</UL>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial010.html#htoc89">Appendix&nbsp;A&nbsp;&nbsp;Style Guide</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial010.html#htoc90">A.1&nbsp;&nbsp;Style rules</A>
<LI CLASS="li-toc"><A HREF="tutorial010.html#htoc91">A.2&nbsp;&nbsp;Module structure</A>
<LI CLASS="li-toc"><A HREF="tutorial010.html#htoc92">A.3&nbsp;&nbsp;Predicate definition</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial011.html#htoc93">Appendix&nbsp;B&nbsp;&nbsp;Layout Rules</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial011.html#htoc94">B.1&nbsp;&nbsp;General guidelines</A>
<LI CLASS="li-toc"><A HREF="tutorial011.html#htoc95">B.2&nbsp;&nbsp;Predicates and clauses</A>
<LI CLASS="li-toc"><A HREF="tutorial011.html#htoc96">B.3&nbsp;&nbsp;If-then-elses</A>
<LI CLASS="li-toc"><A HREF="tutorial011.html#htoc97">B.4&nbsp;&nbsp;Disjunctions</A>
<LI CLASS="li-toc"><A HREF="tutorial011.html#htoc98">B.5&nbsp;&nbsp;Do loops</A>
<LI CLASS="li-toc"><A HREF="tutorial011.html#htoc99">B.6&nbsp;&nbsp;Comments</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc100">Appendix&nbsp;C&nbsp;&nbsp;Core Predicates</A>
<UL CLASS="ftoc2"><LI CLASS="li-toc">
<A HREF="tutorial012.html#htoc101">C.1&nbsp;&nbsp;Modules</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc102">C.2&nbsp;&nbsp;Predicate definition</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc103">C.3&nbsp;&nbsp;Control</A>
<UL CLASS="ftoc3"><LI CLASS="li-toc">
<A HREF="tutorial012.html#htoc104">C.3.1&nbsp;&nbsp;Do Loops</A>
</UL>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc105">C.4&nbsp;&nbsp;I/O</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc106">C.5&nbsp;&nbsp;Arrays</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc107">C.6&nbsp;&nbsp;Hash Tables</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc108">C.7&nbsp;&nbsp;Arithmetic</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc109">C.8&nbsp;&nbsp;Terms and structures</A>
<LI CLASS="li-toc"><A HREF="tutorial012.html#htoc110">C.9&nbsp;&nbsp;List Handling</A>
</UL>
</UL>
<HR>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial002.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
